<?php
require_once '../../includes/global.php';
header("Content-type: text/html; charset= UTF-8");
//Jc('g');
//得到配置文件
$wcfg=Dga('wcfg',"web like '".$sitename."'");
$wcfg=json_decode($wcfg[wcfg],true);
$dcfg=Dga('dcfg',"id like '".$_GET[did]."'");
$dcfg=json_decode($dcfg[dcfg],true);

if($_GET['gid']==''){
Jt($_SERVER['HTTP_REFERER'],'信息不存在！');
}//gid
$nowinfo=Dgs($dcfg[name]," gid='".$_GET[gid]."'");
//Jc($nowinfo);
	foreach($nowinfo as $key =>$tinfo){
	$info[$tinfo['lg']]=$tinfo;
	}


//Jc($dcfg);
//检测多语言屏蔽
if (array_key_exists($_GET['did'], $wcfg['ping'])) {
	$wcfg['num'] = 1;
	$temp = $wcfg['lang'][$wcfg['ping'][$_GET['did']]];
	unset ($wcfg['lang']);
	$wcfg['lang'][$wcfg['ping'][$_GET['did']]] = $temp;
}
/*
 * 当前语言环境
 * -Bic	2009年8月13日 14时29分51秒
 */
!$_GET['lg'] && $_GET['lg']='zh';
//Jc($wcfg);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Prosperous JIMU</title>
<link  href="../css/mod.css"  rel="stylesheet" type="text/css" />
<link  href="/jimu/lytebox/lytebox.css"  rel="stylesheet" type="text/css" />
<script src="/jimu/lytebox/lytebox.js" type="text/javascript" ></script>

<script language="javascript">
window.onload = function(){
	var str1 = "?";
	var links = document.getElementsByTagName("A")||document.all.tags("A");
	var total = links.length;
	for (i = 0; i < total; i++) {
		var s = links[i].href.indexOf(str1);
		if (s > 0) {
			links[i].href = links[i].href + '&from=b&mid=<?php echo $_GET[mid];?>';
		}
		else {
			links[i].href = links[i].href + '?from=b&mid=<?php echo $_GET[mid];?>';
		}
	}
}
</script>

</head>
<body>

<div id="container">
<div id="title">
    <ul>
<?php $i=1;
	    foreach($wcfg[lang] as $key =>$lg){
			if($key==$_GET['lg']){
				$lg_num=$i;
				 $temp1="class=\"selectli".$i."\"";
				 $temp2="class=\"selectspan".$i."\"";
			}else{
				 $temp1="";
				 $temp2="";
			}

		echo "<li id=\"tag".$i."\"><a href=\"###\" onclick=\"switchTag('tag".$i."','content".$i."');this.blur();\" ".$temp1."><span ".$temp2.">".$dcfg['title']."【".$lg."】</span></a></li>";
		$i++;
		}
?>
    </ul>

<script type="text/javascript">
<!--
function switchTag(tag,content){
	var allnum=<?php echo $wcfg[num];?>;
	for(i=1; i <= allnum; i++)
	{
		if ("tag"+i==tag)
		{
			document.getElementById(tag).getElementsByTagName("a")[0].className="selectli"+i;
			document.getElementById(tag).getElementsByTagName("a")[0].getElementsByTagName("span")[0].className="selectspan"+i;
		}else{
			document.getElementById("tag"+i).getElementsByTagName("a")[0].className="";
			document.getElementById("tag"+i).getElementsByTagName("a")[0].getElementsByTagName("span")[0].className="";
		}
		if ("content"+i==content)
		{
			document.getElementById(content).className="";
		}else{
			document.getElementById("content"+i).className="hidecontent";
		}
		document.getElementById("content").className=content;
	}
}
-->
</script>
  </div>
  <div id="content" class="content<?php echo $lg_num; ?>">
<?php
$xhgs=1;
 foreach($wcfg[lang] as $lgk =>$lgv){
		 //if($xhgs==1){
		 //echo " <div id=\"content".$xhgs."\" >";
				 //}else{
				 //echo "<div id=\"content".$xhgs."\" class=\"hidecontent\">";
				 //}

			$tmp_class='';
			//echo $lgk;
			if($lgk!=$_GET['lg']){
				$tmp_class="class='hidecontent' ";
			}
			echo "<div id=\"content{$xhgs}\" {$tmp_class} >";

		echo "<fieldset><legend>><img src='../img/page_html.gif' border='0'  style='display:left;vertical-align:middle;' ait='浏览'> ".$dcfg[title]."浏览〖SHOW〗</legend>";
		//内容开始
		$did=$_GET['did'];
		$_GET['bdb']!=''?($did.='&bdb='.$_GET['bdb']):'';
		$_GET['bdid']!=''?($did.='&bdid='.$_GET['bdid']):'';
		echo "<a href='l.php?did=".$did."&{$_GET[pagename]}={$_GET[$_GET[pagename]]}&lg={$lgk}' title='列表【LIST】'><img src='../img/table.gif' border='0' ait='列表【LIST】'></a>    <a href='#' onclick=\"location.reload();\" title='刷新【REFRESH】'><img src='../img/page_refresh.gif' border='0' ait='刷新【REFRESH】'></a>  <a href='javascript:history.go(-1)'  title='后退【BACK】'><img src='../img/arrow_rotate_anticlockwise.png' border='0' ait='后退【BACK】'></a>";
		?>


        </fieldset>

		<br />

      <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0"  bordercolor="#999999"  style="border-collapse: collapse">
		<tr>
        </tr>
        <!-- 表头 !-->
        <tr>
        <td height='30' align='center'><b>标题〖Title〗</b></td>
        <td height='30' align='center'><b>信息〖Content〗</b></td>
		</tr>
        <?php

		foreach($dcfg[structure] as $dkey =>$dvalue){
			/*屏蔽的字段*/
			if($dvalue['ban']==1){continue;}

			//全局时间格式化
			if($dvalue['datetimeChange']==1){
				$info[$lgk][$dkey]=date($dvalue['globalformat'],$info[$lgk][$dkey]);
			}

			switch ($dvalue[ftype]){
				case 'text':
				case 'my97':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php text($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					switch($dvalue['change']){
						case 'date':
							echo date("Y-m-d",$info[$lgk][$dkey]);
							break;
						case 'datetime':
							echo date("Y-m-d H:i:s",$info[$lgk][$dkey]);
							break;
						default:
							echo $info[$lgk][$dkey];
							break;
					}
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'md5str':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php md5str($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					echo  "加密字符串".$info[$lgk][$dkey];
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'phpfile':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php phpfile($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					echo "加密json字符串<BR>";
					Jc(json_decode($info[$lgk][$dkey],true));
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'fileup':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php fileup($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					$picarray=array('jpg','gif','png','bmp');
					$nopic=explode(',',$info[$lgk][$dkey]);
						foreach($nopic as $nowvalue){
							if(in_array(substr($nowvalue,-3,3),$picarray)){
							echo "<img src='/uploads/pic/".$nowvalue."'></img>";
							}else{
							echo "<a href='/uploads/pic/".$nowvalue."'>附件</a>";
							}

						}
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'fileupBic':
				case 'fileupFs':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php fileup($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					$path=$dvalue['path']==''?'/uploads/pic/':$dvalue['path'];
					$picarray=array('jpg','gif','png','bmp');
					$nopic=explode(',',$info[$lgk][$dkey]);
						foreach($nopic as $nowvalue){
							if(in_array(substr($nowvalue,-3,3),$picarray)){
							echo "<a href='".$path.$nowvalue."' rel='lytebox' style='border:0;'><img src='".$path.$nowvalue."' alg='点击查看原图' title='点击查看原图' style='margin-left:50px;width:50px;height:50px;border:0;'/></a>";
							}else{
							echo "<a href='".$path.$nowvalue."'>附件</a>";
							}

						}
				?></td>
              </tr>
                 <?php
				 break;
				}

				case 'hide':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php hide($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					echo $info[$lgk][$dkey];
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'select':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php select($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					echo yinyong($dkey,1,$info[$lgk][$dkey])
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'checkbox':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php checkbox($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					echo yinyong($dkey,1,$info[$lgk][$dkey])
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'radio':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php radio($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					echo yinyong($dkey,1,$info[$lgk][$dkey])
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'textarea':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php textarea($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
				echo $info[$lgk][$dkey];
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'ubb':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php ubb($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					echo $info[$lgk][$dkey];
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'bind':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php echo  $dvalue['COMMENT']?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
					if($dvalue['filter']['open']!=1){
					echo "	<a href='c.php?did=".$dvalue['did']."&bdb=".$_GET['did']."&bdid=".$_GET['gid']."&comment=".urlencode($dvalue['COMMENT'])."' title='添加".$dvalue['COMMENT']."【AddBind】'><img src='../img/image_new.gif' border='0' ait='添加".$dvalue['COMMENT']."【AddBind】'></a>
							<a href='l.php?did=".$dvalue['did']."&bdb=".$_GET['did']."&bdid=".$_GET['gid']."&comment=".urlencode($dvalue['COMMENT'])."' title='列表".$dvalue['COMMENT']."【Listbind】'><img src='../img/image.gif' border='0' ait='列表".$dvalue['COMMENT']."【Listbind】'></a>
							";
					}else if(in_array($info[$lgk]['gid'],preg_split("/,|#/",$dvalue['filter']['data']))){
					echo "	<a href='c.php?did=".$dvalue['did']."&bdb=".$_GET['did']."&bdid=".$_GET['gid']."&comment=".urlencode($dvalue['COMMENT'])."' title='添加".$dvalue['COMMENT']."【AddBind】'><img src='../img/image_new.gif' border='0' ait='添加".$dvalue['COMMENT']."【AddBind】'></a>
							<a href='l.php?did=".$dvalue['did']."&bdb=".$_GET['did']."&bdid=".$_GET['gid']."&comment=".urlencode($dvalue['COMMENT'])."' title='列表".$dvalue['COMMENT']."【Listbind】'><img src='../img/image.gif' border='0' ait='列表".$dvalue['COMMENT']."【Listbind】'></a>
							";
					}
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'dselect':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php dselect($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
				//Ja($info[$lgk][$dkey]);
					echo yinyong($dkey,1,$info[$lgk][$dkey])
				?></td>
              </tr>
                 <?php
				 break;
				}
				case 'ssx':{
				?>
				<tr>
            <td height="30" width="19%" align="right" class="title"><?php ssx($dkey,$lgk,0,0);?>：</td>
            <td width="81%" height="30" align="left" class=con>
				<?php
				//Ja($info[$lgk][$dkey]);
					$ti=1;
					foreach($dvalue['zd'] as $xxskey){
					$xxst=Dga('sss'," id = '".$info[$lgk][$xxskey]."' ");
					echo $xxst['title']."<br>";
					$ti++;
					}
				?></td>
              </tr>
                 <?php
				 break;
				}
			}


}
		?>
		</table>

		<?php
		$xhgs++;
		echo "</div>";
		}
	?>
        </div>

</body>
</html>
